#include<iostream>
#include<Windows.h>
#include<cstdlib>
using namespace std;
const int N = 8192;
long long sum;
int a[N];
void function(int n) {
	if (n == 0)return;
	else {
		for (int i = 0; i < n/2; i++) {
			a[i] += a[n - i - 1];
		}
		n /= 2;
		function(n);
	}
}
int main() {
	unsigned seed=19;
	srand(seed);
	for (int i = 0; i < N; i++) {
		a[i] = rand() % 1000;
	}
	LARGE_INTEGER t1, t2, tc;

	QueryPerformanceFrequency(&tc);

	QueryPerformanceCounter(&t1);
	for (int k = 0; k < 1000; k++) {


		sum = 0.0;
		for (int i = 0; i < N; i++) {
			sum += a[i];
		}

		//int m = N;
		//for (; m > 1; m /= 2) {
		//	for (int i = 0; i < m / 2; i++) {
		//		a[i] = a[2 * i] + a[2 * i + 1];
		//	}
		//}

		//long long sum1=0, sum2=0;
		//for (int i = 0; i < N; i += 2) {
		//	sum1 += a[i];
		//	sum2 += a[i + 1];
		//}
		//sum = sum1 + sum2;

		//function(N);
	}
	QueryPerformanceCounter(&t2);

	cout << "TimeConsume:" << ((t2.QuadPart - t1.QuadPart) * 1.0 / tc.QuadPart);

}